<template>
    <div>
        <el-header style="box-shadow: rgba(0, 0, 0, 0.05) 0px 2px 20px 0.5px;border-radius:6px;padding:20px;height:54px">
              <el-breadcrumb separator="/">
                  <el-breadcrumb-item :to="{ path: '/home' }"
                  >首页</el-breadcrumb-item>
                  <el-breadcrumb-item>人事调动</el-breadcrumb-item>
                  <el-breadcrumb-item>我的调科</el-breadcrumb-item>
              </el-breadcrumb>
        </el-header>
        <el-main style="box-shadow: rgba(0, 0, 0, 0.05) 0px 2px 20px 0.5px;border-radius:6px;margin-top:10px">
          <el-card shadow="never">
            <el-row :gutter="0" type="flex" justify="space-between">
              <label class="el-form-item__label"><el-tag size="medium">{{name}}</el-tag></label>
              <label class="el-form-item__label">科室：<el-tag type="info">{{dept}}</el-tag></label>
              <label class="el-form-item__label">片区：<el-tag type="warning">{{dict}}</el-tag></label>
            </el-row>
          </el-card>
            <el-divider></el-divider>
          <el-card>
            <el-row :gutter="0" type="flex" justify="space-between">
              <label class="el-form-item__label">调科档案</label>
              <span>
                    <label class="el-form-item__label">选择年份</label>
                    <el-date-picker v-model="time" value-format="yyyy" type="year"></el-date-picker>
                </span>
            </el-row>
            <el-table
              v-loading="showHistory"
              :data="tableData"
              border
              height="480"
              style="width: 100%;margin-top:10px"
              :header-cell-style="{ background: 'rgb(245,247,250)' }">
              <el-table-column
                prop="name"
                label="姓名">
              </el-table-column>
              <!-- <el-table-column
                prop="name"
                label="类别">
              </el-table-column>
              <el-table-column
                prop="address"
                label="类型">
              </el-table-column> -->
              <el-table-column
                prop="from"
                label="调出科室">
              </el-table-column>
              <el-table-column
                prop="to"
                label="调入科室">
              </el-table-column>
              <!-- <el-table-column
                prop="address"
                label="职称">
              </el-table-column> -->
              <el-table-column
                prop="duties"
                label="职务">
              </el-table-column>
              <el-table-column
                prop="time"
                label="到岗时间">
              </el-table-column>
              <el-table-column
                prop="reason"
                label="调科原因">
              </el-table-column>
              <el-table-column
                prop="handleMan"
                label="操作人">
              </el-table-column>
              <!-- <el-table-column
                prop="address"
                label="操作原因">
              </el-table-column> -->
            </el-table>
          </el-card>

        </el-main>
    </div>
</template>
<script>
import TaskManager from '../service/TaskManager'
export default {
    name:'myTrans',
    data(){
        return{
          id:'',
          showHistory:false,
          name:"",
          dept:"",
          dict:"",
          time:"",
          tableList:[],
        }
    },
    methods:{
      getTransferList(){
        this.showHistory=true;
        this.tableData=[];
          TaskManager.getTransferHistory({id:this.id}).then((res)=>{
            this.tableData=res.data.data;
            this.showHistory=false;
          })
      }
    },
    mounted(){
      this.name=window.localStorage.name;
      this.dept=window.localStorage.dept;
      this.dict=window.localStorage.dept;
      this.getTransferList();
    }
}
</script>
<style scoped>

</style>
